function act() {
    cm.openScriptNpc()
}
var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            em.setProperty("final_end", "1");
            eim.getPlayers().forEach(function (e) {
                e.getAPI().fieldEffect_ScreenMsg("quest/party/clear");
                e.getAPI().fieldEffect_PlayFieldSound("Party1/Clear", 100);
                e.getAPI().gainItem(5062024, 1);
                e.getAPI().gainItem(5062500, 2);
                e.getAPI().gainItem(5062010, 2);
                e.getAPI().addTrait("意志", 30)
            });
            cm.getPlayer().endPartyQuest(1206);
            cm.dispose()
        }
    }
};